<script type="text/javascript">
<!--
//	function ShowInfo(object){
//		var html = object.find("img").parent().attr("name");
//		if(object.find(".info").length == 0){
//			object.append("<div class=\"info\"></div>").find(".info")
//			.html(html);
//
//		}
//		object.find(".info").hide()
//		.css({			
//			"margin-top":"10px",
//			"position":"relative",
//			"background":"black",
//			"bottom":"40px;",	
//			"top":"-200px",			
//			"padding":"10px",
//			"textAlign":"left",
//			"height":"245px",
//			"opacity":.5
//			
//		})		
//		.animate({	
//			"opacity":.8
//			
//		}).stop().slideDown().stop();
//
//	}
//
//	function HideInfo(object){
//		object.find(".info")
////		.animate({
////			"opacity":.2
////		},5000)
//		.stop()
//		.slideUp()
//	}

//-->
</script>

<div id="<?php echo $this->id;?>">
<?php	foreach ($dataProvider as $model): ?>


	<h3 style="border-bottom:1px dashed grey;padding-bottom:5px;">
		<?php echo CHtml::image('/public/images/folder/flower_folders_0'.rand(0, 9).'.png',$model->cate_name,array('width'=>'20','class'=>'left'));?>
		&nbsp;&nbsp;
		<?php echo CHtml::link($model->cate_name,array('list','id'=>$model->cate_id,'m'=>urlencode($model->cate_name)));?>
		<span class="right">
			<?php echo CHtml::link(Yii::t('common','More'),array('list','id'=>$model->cate_id,'m'=>urlencode($model->cate_name)),array('style'=>'font-size:12px'));?>
		</span>
	</h3>

	<ul class="items">
		
		<?php $media = $model->media;?>
		<?php if($media):?>
		<?php $i = 1;?>
		<?php foreach ($media as $data):?>
			<?php if($i > $this->limit) break; else $i++;?>
		
		<li id="product-item-view" style="text-align:center;"  onmouseover="ShowInfo($(this));" onmouseout="HideInfo($(this));">
	        <div>
			<?php
// 	            $path = Yii::app()->params['uploadProductPath'];
// 	            $img = $path.date('Y',$data->folder->file_created).'/'.date('m',$data->folder->file_created).'/'.date('d',$data->folder->file_created).'/'.$data->folder->file_links.'_thumb.'.$data->folder->file_ext;

	            
	            $img = File::model()->generateFilePath(File::model()->findByPk($data->media_pic_id),0);

	            echo CHtml::link(CHtml::image($img,$data->media_name),array('work/view','id'=>$data->media_id),array(
	            	'name'=>'<div style=""><span>名称:</span>'. UtilTools::strSlice($data->media_name,0,8).'<br /><span>描述:</span>'.UtilTools::strSlice($data->media_describe,0,33).'<br /><span>时间:</span>'.date('Y/m/d',$data->media_created).'</div>',
	            	'class'=>'cateimage'
	            ));
	        ?>	
	        </div>
	        <div class="des">
	        <br />
	    		<?php echo CHtml::link($data->media_name, array('view','id'=>$data->media_id));?>
	 
	        </div>
		</li>
		<?php endforeach;?>	
		<?php else:?>
		<li style="text-align:center;">
			<hr class="space" />
			
	        <div class="des">
	        	<span> 此分类还未增加内容……</span>
	    		
	        </div>
	        <hr class="space" />
		</li>		
		<?php endif;?>
	</ul>
	<hr class="space" />
<?php endforeach;?>
</div>